spark_add_executable_path(${PROJECT_NAME}
    src
    src/adapter
    main.cpp 
    mainwindow.cpp
    mainwindow.h
)
target_link_qt(${PROJECT_NAME})

spark_framework_include_with_git(${PROJECT_NAME}
    https://gitee.com/spark-framework-libs/spark-framework-features
    FEATURES version screenutil eaters)

spark_framework_include_with_git(${PROJECT_NAME}
    https://gitee.com/spark-framework-libs/network-access-libs
    FEATURES httpmanager)

spark_framework_include_with_git(${PROJECT_NAME}
    https://gitee.com/spark-framework-libs/qutils
)

include(examples/dev.cmake)

set(BUNDLE_ICON       "assets/icon.png")
# set(BUNDLE_PREFIX     "dist/${PROJECT_NAME}") # pyistaller
set(BUNDLE_PACKAGE    "com.gitee.zinface.${PROJECT_NAME}")
set(BUNDLE_EXECUTABLE "${BUNDLE_PACKAGE}/${PROJECT_NAME}")

install(TARGETS ${PROJECT_NAME}
    DESTINATION /opt/apps/${BUNDLE_PACKAGE}
)
install(FILES
    ${BUNDLE_ICON}
    DESTINATION /usr/share/icons/hicolor/512x512/apps
    RENAME ${BUNDLE_PACKAGE}.png
)

##
# [Desktop Entry] For Linux 
# 内容默认应用名称: Name= 应与项目名称相同
spark_desktop_macros(
    # 应用名称: Name=
    "Ollama Qwen Client"
    # 应用名称: Name[zh_CN]=
    "Ollama 千问客户端"
    # 应用说明: Comment=
    "基于 PySide6 的 Ollama 千问客户端"
    # 应用类型: Type=
    "Application"
    # 执行程序: Exec=
    "/opt/apps/${BUNDLE_EXECUTABLE}"
    # 图标路径: Icon=
    "${BUNDLE_PACKAGE}"
    # 应用分类: Categories=
    "Utility"
    # MIME类型: MimeType=
)
install(FILES ${SPARK_DESKTOP_FILE}
    DESTINATION /usr/share/applications
    RENAME ${BUNDLE_PACKAGE}.desktop
)
##
# [deb] For Linux(with dpkg)
# 注释行(使用方式)
add_package_descript(cmake/spark-deb-package.descript)
